package com.baixiaowen.javainterview.aop;

public class AliPay implements Payment{

    private Payment payment;

    public AliPay(Payment payment) {
        this.payment = payment;
    }

    public void beforePay() {
        System.err.println("从招行取款");
    }

    public void afterPay() {
        System.err.println("支付给慕课网");
    }

    @Override
    public void pay() {
        beforePay();
        payment.pay();
        afterPay();
    }
}
